﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using StackExchange.Profiling.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using WxApp.Entity;

namespace WxApp.User
{
    [ApiController]
    [Route("[controller]")]
    public class UserController : ControllerBase
    {
        private static readonly string[] Summaries = new[]
        {
        "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
    };

        private readonly ILogger<UserController> _logger;


        public UserController(ILogger<UserController> logger)
        {
            _logger = logger;
        }

        [HttpGet(Name = "UserController")]
        public string Get(string id)
        {
            UserService userService = new UserService(new WxCore.Sqlsugar.SqlSugarRepository<Entity.UserEntity>());
            var user = userService.repo.Context.Queryable<UserEntity>().Where(x => x.id == id).ToList();

            return user.ToJson();
        }
    }
}
